home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / graphicgems4.lha / GemsIV / arcball / BallAux.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-06  |  675 b   |  25 lines

  1. /***** BallAux.h - Vector and quaternion routines for Arcball. *****/
  2. #ifndef _H_BallAux
  3. #define _H_BallAux
  4.  
  5. typedef int Bool;
  6. typedef struct {float x, y, z, w;} Quat;
  7. enum QuatPart {X, Y, Z, W, QuatLen};
  8. typedef Quat HVect;
  9. typedef float HMatrix[QuatLen][QuatLen];
  10.  
  11. extern Quat qOne;
  12. HMatrix *Qt_ToMatrix(Quat q, HMatrix out);
  13. Quat Qt_Conj(Quat q);
  14. Quat Qt_Mul(Quat qL, Quat qR);
  15. HVect V3_(float x, float y, float z);
  16. float V3_Norm(HVect v);
  17. HVect V3_Unit(HVect v);
  18. HVect V3_Scale(HVect v, float s);
  19. HVect V3_Negate(HVect v);
  20. HVect V3_Sub(HVect v1, HVect v2);
  21. float V3_Dot(HVect v1, HVect v2);
  22. HVect V3_Cross(HVect v1, HVect v2);
  23. HVect V3_Bisect(HVect v0, HVect v1);
  24. #endif
  25.